<style type="text/css">
	.pHead {
		margin-bottom: 5px;
		margin-top: 5px;
	}	
</style>

<!-- js su dung cho phan quyen -->
<script type="text/javascript" src="<?php echo base_url()?>js/back_end/lib.js"></script>
	
<p class='msview'>
	<span style="color: #8E0202;">
		<?php echo $this->session->flashdata('msview'); ?>
	</span>
</p>
<div class="header2">
	<p class="pHead">Phân quyền cho thành viên &nbsp;<u style="font-weight: bold;"><?php echo $admin_user;?></u></p>
</div>
<div class="contentMain">	

<form name="AdminPermission" id="AdminPermission" action="<?php echo base_url() ?>back_end/admins/permission/<?php echo $admin_id; ?>" method="POST">
	<table class="content_ct_show_ct_tbl" width="100%">   
		<tr class="content_ct_show_ct_tbl_top">
			<td width="5%" class="tdPr7"  height="25">
				STT
			</td>
			<td width="15%" class="tdPr7">Tên controller</td>
			<td width="25%" class="tdPr7">Tên menu</td>
			<td width="15%" class="tdPr7">Tất cả</td>
			<td width="10%" class="tdPr7">Xem</td>
			<td width="10%" class="tdPr7">Thêm</td>
			<td width="10%" class="tdPr7">Sửa</td>
			<td width="10%" class="tdPr7">Xóa</td>
		</tr>
	<?php
		 $count = 1;
		 
		 foreach ($menu as $m) {
		 	 $count += 1;
	?>
	
	<tr class="<?php if ($count%2) { echo 'content_ct_show_ct_tbl_bt_1'; } else { echo 'content_ct_show_ct_tbl_bt_2'; }  ?>">
		<td width="5%" class="tdPr7">
			<?php echo $count;?>
		</td>
		<td width="15%" class="tdPr7">
			<a href="#" style="text-decoration: none; color: #333;"><?php echo $m['controller']; ?></a>
		</td>
		<td width="25%" class="tdPr7">
			<?php echo $m['name']; ?>
		</td>
		<td width="15%" class="tdPr7">
			<?php $input_ck = $m['admins_id'].'_'.$m['id_menu']; ?>
			<a href="#" style="text-decoration: underline; color: #888;" onclick="checkAllPermiss('<?php echo  $input_ck; ?>')">CheckAll</a>
			<a href="#" style="text-decoration: underline; color: #888; padding-left: 5px;" onclick="unCheckAllPermiss('<?php echo $input_ck; ?>')">UnCheck</a>
		</td>
		<td width="10%" class="tdPr7">
			<input type="checkbox" name="Index_<?php echo $m['admins_id'].'_'.$m['id_menu']; ?>" id="Index_<?php echo $m['admins_id'].'_'.$m['id_menu']; ?>" value="1" <?php if ($m['index']==1){ echo 'checked'; } ?>  />
		</td>
		<td width="10%" class="tdPr7">
			<input type="checkbox" name="Add_<?php echo $m['admins_id'].'_'.$m['id_menu']; ?>" id="Add_<?php echo $m['admins_id'].'_'.$m['id_menu']; ?>" value="1" <?php if ($m['add']==1){ echo 'checked'; }  ?> />
		</td>
		<td width="10%" class="tdPr7">
			<input type="checkbox" name="Edit_<?php echo $m['admins_id'].'_'.$m['id_menu']; ?>" id="Edit_<?php echo $m['admins_id'].'_'.$m['id_menu']; ?>" value="1" <?php if ($m['edit']==1){ echo 'checked'; } ?> />
		</td>
		<td width="10%" class="tdPr7">
			<input type="checkbox" name="Delete_<?php echo $m['admins_id'].'_'.$m['id_menu']; ?>" id="Delete_<?php echo $m['admins_id'].'_'.$m['id_menu']; ?>" value="1" <?php if ($m['delete']==1){ echo 'checked'; }?>/>
		</td>
	</tr>
	<?php 
		}
	?>
	
	<tr class="contentList">
		<td class="tdPr7" colspan="8">
			<input type="submit" value="Cập Nhật" class="buttonSM" name="add" />
			<input type="reset" value="Làm Lại" class="buttonSM" />
		</td>
	</tr>
</table>
</form>
</div>